package com.neusoft.tijiancms.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.tijiancms.po.OverallResult;
import com.neusoft.tijiancms.service.OverallResultService;

@RestController
@RequestMapping("/overallResult")
public class OverallResultController {

	@Autowired
	private OverallResultService overallResultService;

	/**
	 * 查询出总检结论，并做展示
	 * @param overallResult
	 * @return
	 */
	@RequestMapping("/listOverallResultByOrderId")
	public List<OverallResult> listOverallResultByOrderId(@RequestBody OverallResult overallResult) {
		return overallResultService.listOverallResultByOrderId(overallResult.getOrderId());
	}

	/**
	 * 保存总检结论
	 * @param overallResult
	 * @return
	 */
	@RequestMapping("/saveOverallResult")
	public int saveOverallResult(@RequestBody OverallResult overallResult) {
		return overallResultService.saveOverallResult(overallResult);
	}

	/**
	 * 更新总检结论
	 * @param overallResult
	 * @return
	 */
	@RequestMapping("/updateOverallResult")
	public int updateOverallResult(@RequestBody OverallResult overallResult) {
		return overallResultService.updateOverallResult(overallResult);
	}

	/**
	 * 删除总检结论
	 * @param overallResult
	 * @return
	 */
	@RequestMapping("/removeOverallResult")
	public int removeOverallResult(@RequestBody OverallResult overallResult) {
		return overallResultService.removeOverallResult(overallResult.getOrId());
	}
}
